<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div style="width: 500px;margin: 0 auto;">
		<form action="ByBreedServlet">
		    品种<select name="petBreed">
				<option value="0">--请选择--</option>
				<option value="1">狗</option>
				<option value="2">猫</option>
				<option value="3">鸟</option>
				<option value="4">兔</option>
			</select>
			<input type="submit" value="查询">
			<a href="add.jsp">新增宠物</a>
		</form>
		<table border="1">
			<tr>
				<th>宠物昵称</th>
				<th>出生日期</th>
				<th>性别</th>
			</tr>
			<c:forEach items="${list }" var="pet" >
				<tr>
					<td>${pet.petName }</td>
					<td>${pet.birthday.substring(0,10) }</td>
					<td>
						<c:if test="${pet.petSex==1 }">雄</c:if>
						<c:if test="${pet.petSex==2 }">雌</c:if>
					</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>